﻿{include file="./public/static/block/index/head.html"}
{include file="./public/static/block/index/leftNav.html"}


<!--内容部分-->
<div class="side-content ">
    <!--列表-->
    <section class="w-message-details">
        <div class="w-message-details-content">
            <div style="overflow-y: hidden" class="w-box-c-left w-content-left">
                <div class="w-article-details">
                    <p>{$news.title}</p>
                    <div>
                        <p>
                            <img src="{if $news.u_face}{$news.u_face|get_uploads}{else}__IMG__/w-ht-logo.png{/if}" alt=""/>
                            <span>{$news.uname}</span>
                        </p>
                        <span>{$news.dateline|date='Y-m-d',###}</span>
                    </div>
                </div>
                <div class="w-box-article">
                    {$news.content}
                </div>
            
                <div class="w-comment-content">
                    <form action="{:get_index('news/addcomment')}" method="post">
                        <p>评论</p>
                        <input type="hidden" name="news_id" value="{$news.news_id}">
                        <textarea name='content'></textarea>
                        <div>
                           <button id="btn" type="submit">发表</button> 
                        </div>
                        
                    </form>
                </div>
                <div class="w-comment-details">
                    <ul>
                        {volist name='comments' id= 'comment'}
                        <li>
                            <a href="javascript:;">
                                <img src="{if $comment.u_face}{$comment.u_face|get_uploads}{else}__IMG__/w-ht-logo.png{/if}" alt=""/>
                                <p><var style="font-style: normal">{$comment.uname}：</var>{$comment.content}</p>
                                <span>{$comment.dateline|date='Y-m-d',###}</span>
                            </a>
                        </li>
                        {/volist}
                    </ul>
                    <style type="text/css">
                            .w-message-page{

                            }
                            .w-message-page>a{
                                 padding:5px 10px;
                                 border:none !important;
                                 color:#00c0ff;
                                 background: #eee;
                            }
                            .w-message-page>a.btn-class{
                                color:#;
                                background: #00c0ff;
                                color:#fff;
                                
                            }
                        </style>
                    <!--分页-->
                    <div class="w-message-page">
                        {for start="1" end="$pageCount+1" step="1" name="i"}
                            <a {if $i == $page}class="btn-class"{/if} href="{:get_index('news/detail',['news_id'=>$news.news_id])}?page={$i}" >{$i}</a>
                            {/for}
                    </div>
                </div>
            </div>
            <div class="w-box-c-right">
                <div style="" class="w-message-hot">
                    <div style="border: 1px dashed #959595;background: #fff;" class="w-message-hot-content">
                        <p>
                            <img src="images/w-hot.png" alt=""/>
                            <span>热门推荐</span>
                        </p>
                        <ul>
                            {volist name = 'hots' id='item'}
                            <li><a href="{:get_index('news/detail',['news_id'=>$item.news_id])}">{$item.title}</a></li>
                            {/volist}
                        </ul>
                    </div>
                </div>
            </div>
            <script type="text/javascript">
                var a=1;
                $('#btn').on('click',function(){
                    $.ajax({
                        url:'http://ucenter.znc365.com/index.php/auth/isLogin',
                        type:'GET',
                        async:false,
                        data:'',
                        success:function(data){
                            if(data.code==200){
                                if(data.data==0){
                                    alert('你还没有登录,请先登录!');
                                     $('.w-yn-login-mash').fadeIn();
                                     $('.w-login').show();
                                     a=1;
                                     $('.pp').val('1');
                                }else if (data.data==1) {
                                    a=2;
                                }
                            }else{
                                alert('获取登录状态失败!')
                            }
                        }
                    });
                    if(a==1){
                    return false;
                    }else if(a==2){
                        return true;
                    }
                });


            </script>
        </div>
    </section>

        {include file="./public/static/block/index/foot.html"}
